package com.game.model;

import com.game.model.api.Property;
import com.game.utils.Format;

/**
 * @Description:基本属性
 **/
public class BaseProperty implements Property {
    private int id;
    private long HP;//血量
    private long MP;//怒气
    private long ATK;//攻击力
    private long DEF;//防御力

    @Override
    public Property getProperty() {
        return this;
    }

    public BaseProperty() {
    }

    public BaseProperty(int id, long HP, long MP, long ATK, long DEF) {
        this.id = id;
        this.HP = HP;
        this.MP = MP;
        this.ATK = ATK;
        this.DEF = DEF;
    }

    public BaseProperty(long HP, long MP, long ATK, long DEF) {
        this.id = Format.getRandomNumber();
        this.HP = HP;
        this.MP = MP;
        this.ATK = ATK;
        this.DEF = DEF;
    }

    public int getId() {
        return id;
    }

    public long getMP() {
        return MP;
    }

    public void setMP(long MP) {
        this.MP = MP;
    }

    public void setId(int id) {
        this.id = id;
    }

    public long getHP() {
        return HP;
    }

    public void setHP(long HP) {
        this.HP = HP;
    }

    public long getMp() {
        return MP;
    }

    public void setMp(long mp) {
        MP = mp;
    }

    public long getATK() {
        return ATK;
    }

    public void setATK(long ATK) {
        this.ATK = ATK;
    }

    public long getDEF() {
        return DEF;
    }

    public void setDEF(long DEF) {
        this.DEF = DEF;
    }

    @Override
    public String toString() {
        return "BaseProperty{" +
                "HP=" + HP +
                ", MP=" + MP +
                ", ATK=" + ATK +
                ", DEF=" + DEF +
                '}';
    }

    public String printInfo() {
        return "[生命:" + HP + ",怒气:" + MP + ",攻击:" + ATK + ",防御:" + DEF + "]";
    }
}
